package com.aaa.controller;

import com.aaa.dao.TextureMapper;
import com.wsc.entity.Texture;
import com.aaa.service.impl.TextureServiceImpl;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("texture")
public class TextureController {
    @Resource
    TextureMapper textureService;
    @RequestMapping("select")
    public List<Texture> select(){
        return textureService.selectList(null);
    }
    @RequestMapping("insert")
    public Integer insert(@RequestBody Texture texture){
        return textureService.insert(texture);
    }
    @RequestMapping("delete")
    public Integer delete(Integer id){
        return textureService.deleteById(id);
    }
    @RequestMapping("update")
    public Integer update(Texture texture){
        return textureService.updateById(texture);
    }
    @Resource
    TextureServiceImpl saveorupdate;
    @RequestMapping("m55")
    public boolean m55(Texture texture){
        boolean b=saveorupdate.saveOrUpdate(texture);
        return b;
    }
}
